package test.pcs;

import com.payment.lc.pcs.client.wrap.bo.ProductionAttributes;
import com.payment.lc.pcs.client.wrap.bo.ProductionPurchaseAttributes;
import com.payment.lc.pcs.client.wrap.bo.ProductionValueAttributes;
import com.payment.lc.pcs.client.wrap.service.ProductionWrapService;
import com.payment.lc.pcs.client.wrap.service.ProductionWrapServiceV20;
import com.payment.lc.pcs.service.api.DynamicDataService;
import com.payment.lc.pcs.service.api.ProductionService;
import com.payment.lc.pcs.service.api.ProductionServiceV20;
import com.payment.lc.pcs.service.bo.ProductionSellInfo;
import com.payment.lc.pcs.service.domain.Production;
import net.rubyeye.xmemcached.MemcachedClient;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import test.BaseTest;

import java.text.SimpleDateFormat;

/**
 * Created on 2016/8/8.
 */
public class Demo1PcsTest3 extends BaseTest {
    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

    @Autowired
    ProductionService productionService;

    @Autowired
    ProductionWrapService productionWrapService;

    @Autowired
    ProductionServiceV20 productionServiceV20;

    @Autowired
    ProductionWrapServiceV20 productionWrapServiceV20;

    @Autowired
    DynamicDataService dynamicDataService;

    @Autowired
    MemcachedClient pcsProductionMemeryClient;

    @Test
    public void test() {
        test2();
    }

    void test3() {
        String prodCode = "SF3508";
        Production production = productionWrapService.getProduction(prodCode);
        ProductionAttributes valueAttributes = productionWrapService.getProductionAttributes(production);
        display(valueAttributes);
    }
    void test1() {
        String prodCode = "SF3508";
        Production production = productionWrapService.getProduction(prodCode);
        ProductionValueAttributes valueAttributes = productionWrapService.getProductionValueAttributes(production, false);
        print(valueAttributes);
    }

    void test2() {
        String prodCode = "SF2883";
        Production production = productionWrapService.getProduction(prodCode);
        ProductionSellInfo productionSellInfo = productionWrapService.getProductionSellInfo(prodCode, false);
        display(productionSellInfo);

        ProductionPurchaseAttributes purchaseAttributes = productionWrapService.getProductionPurchaseAttributes(production, false);
        display(purchaseAttributes);
    }
}